<%@ page import="jakarta.servlet.http.HttpSession" %>
<%@ page import="java.text.SimpleDateFormat" %><%--
  Created by IntelliJ IDEA.
  User: LH
  Date: 2022/9/20
  Time: 18:a03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
  </head>
  <body>
  <%
    HttpSession session1 = request.getSession();
    long creationTime = session1.getCreationTime();
    long lastAccessedTime = session1.getLastAccessedTime();
    long time=lastAccessedTime-creationTime;
    long hour=time/1000/60/60%60;
    long min=time/1000/60%60;
    long second=time/1000%60;
    String s1 = new SimpleDateFormat("yyyy-mm-dd HH:MM:SS").format(creationTime);
  %>
  <%="您本次登录系统的时间为:"+s1%>
  <br>
  <%="您本次在页面停留的时间为："+hour+"时"+min+"分"+second+"秒"%>
  <%
  response.setHeader("refresh","1");
  %>
  </body>
</html>
